import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ItemPageResult } from "./types";

/**
 * 查询赛项组别
 *
 * @param queryParams
 */
export function getDictionaryList(
  queryParams?: any
): AxiosPromise<ItemPageResult> {
  return request({
    url: "/adminApi/dictionary/page",
    method: "get",
    params: queryParams,
  });
}

/**
 * 新增组别
 *
 * @param data
 */
export function dictionaryCreate(data: any) {
  return request({
    url: "/adminApi/dictionary/create",
    method: "post",
    data: data,
  });
}

/**
 * 修改组别
 *
 * @param data
 */
export function dictionaryUpdate(data: any) {
  return request({
    url: "/adminApi/dictionary/update",
    method: "put",
    data: data,
  });
}

/**
 * 删除组别
 *
 * @param id
 */
export function dictionaryDelete(id: number) {
  return request({
    url: "/adminApi/dictionary/delete?id=" + id,
    method: "delete",
  });
}
